﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;


namespace VehicleList.Models
{
    public class Vehicle
    {
        public int vehicleId { get; set; }
        [Required,
            Display(Name = "Year (YYYY)"),
            MaxLength(4, ErrorMessage="Please enter the year using 4 digits"),
            MinLength(4, ErrorMessage="Please enter the year using 4 digits")]
        public string vehicleYear { get; set; }
        
        [Required (ErrorMessage="Please enter vehicle make"),
            Display(Name = "Make")]
        public string vehicleMake { get; set; }
        
        [Required(ErrorMessage="Please enter vehicle model"),
            Display(Name = "Model")]
        public string vehicleModel { get; set; }

        public virtual ICollection<VehicleInfo> VehicleInfos { get; set; }

     }

    public class VehicleInfo
    {
        public int vehicleInfoId { get; set; }
        public string vehicleInfoDescripton { get; set; }
        public string vehicleInfoFuel { get; set; }
        public string vehicleInfoDrive { get; set; }
        public string vehicleInfoTransmission { get; set; }
        public string vehicleInfoMileage { get; set; }
        public int vehicleId { get; set; }

        public virtual Vehicle Vehicles { get; set; }

    }
}